package com.cn.exception.problem;

public class ExceptionDemo {

    public static void method2() {
        throw new RuntimeException("RuntimeException thrown in method2");
    }

    public static void method1() {
        try {
            method2();
        } catch (RuntimeException e) {
            System.out.println("Caught in method1: " + e.getMessage());
        }
    }

    public static void main(String[] args) {
        method1();
    }
}